<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui"
	xmlns:fn="http://java.sun.com/jsp/jstl/functions">
<h:body>
	<ui:composition template="/pages/protected/prof/template.xhtml">
		<ui:define name='templatemo_content'>
			<!-- Cabeçalho  -->
			<h2>Componente Curriculares</h2>

			<!-- Lista -->
			<h:form id="listaCompCurrs">
				<p:tabView orientation="left" effect="fade">
				<p:tab title="Atuais">
				<p:dataTable id="tbCompCurrsAtuais" widgetVar="tbCompCurrsAtuais" var="comp"
					value="#{profMB.compAtuais.toArray()}" paginator="true"
					rows="10" paginatorPosition="bottom"
					paginatorTemplate="{PageLinks} {RowsPerPageDropdown}"
					rowsPerPageTemplate="5,10,15"
					emptyMessage="Nenhuma componente foi encontrada.">

					<p:column headerText="Nome" filterBy="#{comp.nome}"
						filterMatchMode="contains">
						<p:commandLink id="ajax" actionListener="#{profMB.showComponente}" style="margin-right:20px;">  
        					<f:setPropertyActionListener value="#{comp}" target="#{profMB.selectedComp}" />
        					<h:outputText value="#{comp.nome}" />    
    					</p:commandLink> 
					</p:column>

					<p:column headerText="Inicio" filterBy="#{comp.dtInicio}"
						filterMatchMode="contains">
						<h:outputText value="#{comp.dtInicio}" />
					</p:column>

					<p:column headerText="Fim" filterBy="#{comp.dtFim}"
						filterMatchMode="contains">
						<h:outputText value="#{comp.dtFim}" />
					</p:column>
				</p:dataTable>

				</p:tab>
				<p:tab title="Todas">
					<p:dataTable id="tbCompCurrsTodas" widgetVar="tbCompCurrsTodas" var="comp"
					value="#{profMB.compTodas.toArray()}" paginator="true"
					rows="10" paginatorPosition="bottom"
					paginatorTemplate="{PageLinks} {RowsPerPageDropdown}"
					rowsPerPageTemplate="5,10,15"
					emptyMessage="Nenhuma componente foi encontrada.">

					<p:column headerText="Nome" filterBy="#{comp.nome}"
						filterMatchMode="contains">
						<p:commandLink id="ajax" actionListener="#{profMB.showComponente}" style="margin-right:20px;">  
        					<f:setPropertyActionListener value="#{comp}" target="#{profMB.selectedComp}" />
        					<h:outputText value="#{comp.nome}" />    
    					</p:commandLink> 
					</p:column>

					<p:column headerText="Inicio" filterBy="#{comp.dtInicio}"
						filterMatchMode="contains">
						<h:outputText value="#{comp.dtInicio}" />
					</p:column>

					<p:column headerText="Fim" filterBy="#{comp.dtFim}"
						filterMatchMode="contains">
						<h:outputText value="#{comp.dtFim}" />
					</p:column>
				</p:dataTable>
				</p:tab>
				</p:tabView>
			</h:form>
		</ui:define>
	</ui:composition>
</h:body>
</html>